proc devoice {nick handle chan otbn1 host botnet} {
  global botnick home bcast

  if {![botisop $chan]} {
    putquick "NOTICE $nick :\0034ERROR - Bot dosen't have op status (+o) in $chan"
    return 0 
  }

  # if noone is specified, assume user is talking about themselves
  # if there is no one with the nickname "me" - allow use of the "me" keyword from StormTCL
  if {($otbn1 == "") || ( ![onchan me $chan] && [string tolower $otbn1] == "me" ) } { 
    set otbn1 $nick

    if {![isvoice $otbn1 $chan]} {
      putquick "NOTICE $nick :\0034ERROR - Not Voiced - You are not currently voiced on $chan"
      return 0
    }

    putlog "!$nick ($host)! devoice $chan" 
    putquick "MODE $chan -v $nick"
    putquick "NOTICE $nick :\0033Sucessfully devoiced \0034$nick\0033 on \0034$chan"  

    if {$bcast == "1"} {
      putquick "PRIVMSG $home :Devoiced \002$nick\002 ($host) on $chan"
    }

    return 0
  }

  if {![onchan $botnet $chan]} {
    putquick "NOTICE $nick :\0034ERROR - $botnet isn't on $chan"
  } else {
    if {![matchattr $handle o|o $chan]} { 
      putquick "NOTICE $nick :\0034ERROR - Not Enough Permissions - You may only devoice yourself."
      return 0
    }

    if {![isvoice $otbn1 $chan]} {
      putquick "NOTICE $nick :\0034ERROR - $botnet is not currently voiced on $chan"
    } else {
      putlog "!$nick ($host)! devoice $chan $botnet"		
      pushmode $chan -v $botnet
      putquick "NOTICE $nick :\0033Sucessfully devoiced \0034$botnet\0033 on\0034 $chan"

      if {$bcast == "1"} {
        putquick "PRIVMSG $home :Devoiced \002$botnet\002 on $chan (Requested By: \002$nick\002 ($host))"
      }
    }
  }
}









